<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script language="javascript" type="text/javascript" src="http://www.ucmaim.com/Public/Ucmaim/Admin/js/jquery.js"></script>
<script src="http://www.ucmaim.com/Public/Ucmaim/Admin/js/frame.js" language="javascript" type="text/javascript"></script>
<link href="http://www.ucmaim.com/Public/Ucmaim/Admin/css/style.css" rel="stylesheet" type="text/css" />

<!--[if IE 6]>
<script src="http://www.ucmaim.com/Public/Ucmaim/Admin/js/DD_belatedPNG.js" language="javascript" type="text/javascript"></script>
<script>
  DD_belatedPNG.fix('.nav ul li a,.top_link ul li,background');   /* string argument can be any CSS selector */
</script>
<![endif]-->
</head>
<body class="showmenu">
<script src="http://www.ucmaim.com/Public/Ucmaim/Admin/js/Admin/common.js" type="text/javascript"></script>
<script src="/Public/DatePicker/DatePicker.js" type="text/javascript"></script>
<link href="/Public/DatePicker/Css/DatePicker.css" type="text/css" rel="stylesheet" />
<table width="100%" height="31px" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
    <tr>
        <td height="31"><div class="titlebt">商品列表</div></td>
    </tr>
</table>

<div class="main">
    <div class="operate">
        <div class="left_pad">
            <form method="post" action="<?php echo U('Admin/Goods/Lists', 'do=Search');?>" id="searchForm" name="searchForm">
                标题：<input type="text" name="keyword" title="关键字" class="inp_default" value="<?php echo ($_GET['keyword']); ?>" placeholder="请输入产品标题/卖家名/卖家电话号码">&nbsp;
                状态：<input type="hidden" name="status" id="status" value="<?php echo ($_GET['status']); ?>">
                <select id="selectS" class="inp_default">
                    <option value="">全部</option>
                    <option value="1">已上架</option>
                    <option value="0">待审核</option>
                    <option value="-1">已下架</option>
                    <option value="-2">审核不通过</option>
                    <option value="-3">商品已删除</option>
                </select>&nbsp;
                <label>发布时间：<input type="text" class="inp_default" style="width:180px; text-align: center;" name="date" id="datePicker" readonly /></label>
                <input type="submit" class="btn_blue" value="查  询">
                <script type="text/javascript">
                    var dateRange1 = new pickerDateRange('datePicker', {
                                isTodayValid: true,
                            <?php if(empty($start)): ?>startDate: '<?php echo date('Y-m-d', time()-2592000);?>',
                            endDate: '<?php echo date('Y-m-d', time());?>',
                    <?php else: ?>
                    startDate: '<?php echo ($start); ?>',
                            endDate:   '<?php echo ($end); ?>',<?php endif; ?>
                    needCompare: false,
                            target: 'searchForm',
                            defaultText: ' ~ ',
                            autoSubmit: true,
                            inputTrigger: 'datePicker',
                            theme: 'ta',
                            magicSelect: false,
                    });
                </script>
            </form>
        </div>
    </div>
    <div class="list">
        <form action="<?php echo U('Admin/Goods/Lists', 'do=sort');?>" method="post" id="form_do" name="form_do">
            <table width="100%">
                <tr>
                    <th>编号</th>
                    <th>标题</th>
                    <th>商品分类</th>
                    <th>卖家名</th>
                    <th>发布时间</th>
                    <th>商品状态</th>
                    <th>库存</th>
                    <th>操作</th>
                </tr>

                <?php if(empty($vlist)): ?><tr><td colspan="9">本区域暂无数据显示...</td></tr>
                    <?php else: ?>
                    <?php if(is_array($vlist)): $i = 0; $__LIST__ = $vlist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><tr>
                            <td><?php echo ($v["goods_id"]); ?></td>
                            <td class="aleft"><a href="<?php echo U('Admin/Goods/Lists', 'do=Edit&'.'id='.$v['goods_id']);?>"><?php echo ($v["goods_title"]); ?></a></td>
                            <td>
                                <?php if(is_array($v["goods_relation"])): $key = 0; $__LIST__ = $v["goods_relation"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vr): $mod = ($key % 2 );++$key; $t = count($v['goods_relation']); ?>
                                <?php if($key > 1): echo ($vr["gc_name"]); ?> <?php if($key < $t): ?>/<?php endif; endif; endforeach; endif; else: echo "" ;endif; ?>
                            </td>
                            <td><?php if(empty($v["member_name"])): echo ($v["member_mobile"]); else: echo ($v["member_name"]); endif; ?></td>
                            <td><?php echo (date("Y-m-d G:i:s",$v["goods_time"])); ?></td>
                            <td class="status<?php echo ($v["goods_status"]); ?>"></td>
                            <td><?php echo ($v["goods_storage"]); ?></td>
                            <td>
                                <a href="<?php echo U('Admin/Goods/Lists', 'do=Edit&id='.$v['goods_id']);?>">查看详情</a>
                                <?php if($v["goods_status"] == 0): ?><a href="<?php echo U('Admin/Goods/Lists', 'do=Verify&id='.$v['goods_id'].'&status=1');?>"> 通过审核</a>
                                <a href="<?php echo U('Admin/Goods/Lists', 'do=Verify&id='.$v['goods_id'].'&status=-2');?>"> 审核不通过</a><?php endif; ?>
                                <?php if($v["goods_status"] == 1): ?><a href="<?php echo U('Admin/Goods/Lists', 'do=Verify&id='.$v['goods_id'].'&status=-1');?>"> 下架</a><?php endif; ?>
                                <?php if($v["goods_status"] != -3): ?><a href="<?php echo U('Admin/Goods/Lists', 'do=Verify&id='.$v['goods_id'].'&status=-3');?>"> 删除</a><?php endif; ?>
                            </td>
                        </tr><?php endforeach; endif; else: echo "" ;endif; endif; ?>

            </table>
        </form>
    </div>
    <div class="page"><?php echo ($show_page); ?></div>
</div>

<script type="text/javascript">
    $('.status1').html("已上架");
    $('.status0').html("待审核");
    $('.status-1').html("已下架");
    $('.status-2').html("审核不通过");
    $('.status-3').html("商品已删除");
    $("#selectS").find("option[value='<?php echo ($_GET['status']); ?>']").attr("selected",true);

    $('#selectS').change(function(){
        var v = $(this).val();
        $('#status').val( v );
    });

</script>
</body>
</html>